<?php
namespace App\Providers;
use App\Exceptions\DinggoHandler;
use Dingo\Api\Exception\Handler as ExceptionHandler;
use Dingo\Api\Provider\DingoServiceProvider as DingoServiceProviders;

//api dinggo
class DinggoServiceProvider extends DingoServiceProviders
{

    # 重写注册 服务；
    protected function registerExceptionHandler()
    {
        $this->app->singleton('api.exception', function ($app) {
            return new DinggoHandler($app['Illuminate\Contracts\Debug\ExceptionHandler'], $this->config('errorFormat'), $this->config('debug'));
        });
    }
}
